<script setup lang="ts">
// 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync()
</script>

<template>
  <view class="navbar" :style="{ paddingTop: safeAreaInsets?.top + 'px' }">
    <view class="center-tabs">
      <view @click="$emit('click', 1)">对局榜</view>
      <view @click="$emit('click', 2)">魅力榜</view>
    </view>
    <view class="left-rules" :style="{ paddingTop: safeAreaInsets?.top + 'px' }">
      <uni-icons type="heart" size="18" color="#bec2c3"></uni-icons>
      <text>规则说明</text>
    </view>
  </view>
</template>

<style lang="scss">
.navbar {
  box-sizing: border-box;
  line-height: 80rpx;
  background-color: #253238;
  box-sizing: border-box;
  width: 100%;
  min-height: 80rpx;
  position: relative;
  font-size: 34rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20rpx 20rpx 0;
  .left-rules {
    line-height: 40rpx;
    color: #bec2c3;
    position: absolute;
    top: 0;
    left: 20rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 22rpx;
  }
  .center-tabs {
    font-weight: bolder;
    display: flex;
    justify-content: space-between;
    color: #8f9ca4;
    width: 250rpx;
    .selected {
      border-bottom: 2px solid #6ed29d;
    }
  }
}
</style>
